{assign var="CommentGroupItems" value=$CommentGroup->getItems()}
<span class="comments-title"><a href="#" onclick="toggleComments()">{$Language->get('comments')} ({if $CommentGroupItems == false}0{else}{$CommentGroupItems|@count}{/if})</a></span>
<div id="comment-group">
	<div id="comment-container">
	{if $CommentGroupItems == false}
		<span class="comments-title">{$Language->get('no_comments')}</span>
	{else}
		{foreach from=$CommentGroupItems item=Comment}
			<div class="comment-item">
				<p class="comment-author">{$Language->get('from')}
				{if $Comment->getAuthorWebSite() != ""}	
					<a href="{$Comment->getAuthorWebSite()}">{$Comment->getAuthor()}</a>
				{else}
					{$Comment->getAuthor()}
				{/if}
				{$Language->get('on')} {$Comment->getDateTime('d.m.Y')}</p>
				<p class="comment-content">{$Comment->getContent()|nl2br}</p>
			</div>
		{/foreach}
	{/if}
	</div>
	<div id="comment-post" class="label120">
	<input type="hidden" id="pageURL" value="{$env.url}" />
	<span class="comments-title">{$Language->get('post_your_comment')}</span>
		{if $IsLogged == true}
				<input type="hidden" name="comment-author" id="comment-author" value="{$UserAccount->getUsername()}" />
				<input type="hidden" name="comment-email" id="comment-email" value="{$UserAccount->getEmail()}" />
				<input type="hidden" name="comment-website" id="comment-website" value="" />
		{else}
			<p><label for="comment-author">{$Language->get('author')}: </label><input type="text" name="comment-author" id="comment-author" /> ({$Language->get('required')})</p>
			<p><label for="comment-email">{$Language->get('author-email')}: </label><input type="text" name="comment-email" id="comment-email" /> ({$Language->get('required')})</p>
			<p><label for="comment-website">{$Language->get('author-website')}: </label><input type="text" name="comment-website" id="comment-website" /></p>
		{/if}
		<p>
			<textarea name="comment-content" id="comment-content" cols="55" rows="6"></textarea>
		</p>
		<p><input class="comment-submit" type="button" value="{$Language->get('post_comment')}" onclick="postComment('{$CommentGroup->getApplicationOwner()}', '{$CommentGroup->getApplicationEntryID()}')" /></p>
	</div>
</div>

<div id="comment-posted-success" class="dialogDivision">
	{$Language->get('comment_post_success')}
</div>

<div id="comment-posted-failure" class="dialogDivision">
	{$Language->get('comment_post_failure')}
</div>